package com.gaoshi.chapter5;

import java.time.LocalDate;

public class EmployeeAb extends Person{
    private double salary;
    private LocalDate hireDay;

    public EmployeeAb(String name, double salary, int year, int month, int day) {
        super(name);
        this.salary = salary;
        this.hireDay = LocalDate.of(year, month, day);
    }

    public double getSalary() {
        return this.salary;
    }

    public LocalDate getHireDay() {
        return this.hireDay;
    }

    public String getDescription() {
        return String.format("an employee with a salary of $%.2f", this.salary);
    }

    public void raiseSalary(double byPercent) {
        this.salary = this.salary * (100 + byPercent) / 100;
    }
}
